package ForthQuestion;

import java.util.ArrayList;
import java.util.List;

/**
 * @author cyt
 * @date 2020/6/14
 */
public class AddStudent {

    public static boolean addStudent(List<Student> students, Student student){
        for(Student s : students){
            if(s.getStudentNum() == student.getStudentNum()){
                System.out.println("该学生已存在，请选择修改或删除功能！");
                return false;
            }
        }
        return students.add(student);
    }

}
